package com.fasteat.mall.mapper;

import com.fasteat.mall.entity.ProductComment;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fasteat.mall.entity.vo.ProductCommentVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author hy
 * @since 2021-01-19
 */

public interface ProductCommentMapper extends BaseMapper<ProductComment> {
    //根据用户id查看用户评论
    @Select("SELECT id,product_id,user_id,start_amount,comment_content,gmt_create,gmt_modified FROM t_mall_product_comment WHERE user_id = #{userId} LIMIT #{limit},#{size}")
    List<ProductComment> selectComment(@Param("userId") String userId, @Param("limit") Integer limit, @Param("size") Integer size);

    List<ProductCommentVo> selectBySql(@Param("userId") String userId, @Param("limit") Integer limit, @Param("size") Integer size);
}
